
class Person {
  name: string
  age: number
  readonly sex: string = '男'
  constructor(name: string, age: number,) {
    this.name = name;
    this.age = age;
  }
  eat() {
    console.log('eat');

  }

}
class Person2 extends Person {
  work() {
    console.log('Work');
  }
}
let per = new Person2('孙悟空', 18);
console.log(per);
per.eat();
per.work()